package com.rightsidetech.system.mapper;

import com.rightsidetech.system.dtos.request.SysAgentResourceRoleResp;
import com.rightsidetech.system.dtos.request.SysResourceUpdateReq;
import com.rightsidetech.system.entity.SysAgentResource;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface SysAgentResourceMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysAgentResource record);

    int insertSelective(SysAgentResource record);

    SysAgentResource selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysAgentResource record);

    int updateByPrimaryKey(SysAgentResource record);

    List<Long> selectResIdAll();

    int insertResourceList(@Param("list")List<SysResourceUpdateReq> list, @Param("createdAt") Date createdAt);

    List<SysAgentResource> selectByParentId(@Param("parentId") Long parentId);

    List<SysAgentResource> selectRoleResourceList(@Param("roleId")Long roleId) throws Exception;

    List<SysAgentResourceRoleResp> selectAllResource() throws Exception;

   SysAgentResourceRoleResp selectAllResourceByLoginId(Long id) throws Exception;

    Long selevtByUrl(@Param("requestURI") String requestURI, @Param("menuUrl") String menuUrl);

    SysAgentResource selectByNameAndPathAndUrl(@Param("name") String name,@Param("path") String path,@Param("url") String url);

    List<Long> selectResourceList(Long roleId);

    int updateIsDel(Long id);
}